home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Demos / Simpsons Cartoon Studio™ Demo / Simpdata / simpmain / 00004_recordManager parent.ls < prev    next >
Encoding:
Text File  |  1996-09-06  |  1.8 KB  |  60 lines

  1. global baseRecordSprOffset, autoHoldFrame, referenceFrameNum, curClipRecord, clipDataField, frameLimit, backgroundSpr, foregroundFXSpr, backgroundFXSpr, onionSkinSpr, currentFrame, scoreData, dispatchTable, bgdData, fgdFXData, bgdFXData, theStageBounds, recordFlag, dirtyFlag
  2.  
  3. on birth me
  4.   set backgroundSpr to 1
  5.   set backgroundFXSpr to 2
  6.   set onionSkinSpr to 15
  7.   set foregroundFXSpr to 16
  8.   puppetSprite(backgroundSpr, 1)
  9.   puppetSprite(backgroundFXSpr, 1)
  10.   puppetSprite(onionSkinSpr, 1)
  11.   puppetSprite(foregroundFXSpr, 1)
  12.   set the blend of sprite onionSkinSpr to 30
  13.   set theStageBounds to rect(72, 36, 553, 401)
  14.   set recordFlag to 0
  15.   set dirtyFlag to 0
  16.   set baseRecordSprOffset to 2
  17.   set frameLimit to 401
  18.   set autoHoldFrame to [[], [], [], [], [], [], [], [], [], [], [], []]
  19.   return me
  20. end
  21.  
  22. on recordClip me, theCategory, currentBank, paletteIndex
  23.   cursor(4)
  24.   set referenceFrameNum to count(scoreData)
  25.   set clipDataField to theCategory & "data"
  26.   set currentClipLine to ((currentBank - 1) * 10) + paletteIndex
  27.   set curClipRecord to value(line currentClipLine of field clipDataField)
  28.   if listp(curClipRecord) then
  29.     set recordFlag to 1
  30.     set theType to getAt(curClipRecord, 1)
  31.     if (theType = "C") or (theType = "S") or (theType = "P") then
  32.       record(animRecMgr)
  33.     else
  34.       if theType = "B" then
  35.         record(bgdRecMgr)
  36.       else
  37.         if theType = "F" then
  38.           record(bgdFXRecMgr)
  39.         else
  40.           if (theType = "X") or (theType = "T") then
  41.             record(fgdFXRecMgr)
  42.           else
  43.             if theType = "L" then
  44.               record(sndLPRecMgr)
  45.             else
  46.               if theType = "N" then
  47.                 record(sndFXRecMgr)
  48.               end if
  49.             end if
  50.           end if
  51.         end if
  52.       end if
  53.     end if
  54.     set recordFlag to 0
  55.   else
  56.     put "no clip record available"
  57.     cursor(-1)
  58.   end if
  59. end
  60.